/**
 * 日志工具
 */

class Logger {
  static info(module, message, data = {}) {
    console.log(`[INFO][${module}] ${message}`, JSON.stringify(data, null, 2))
  }

  static error(module, message, error) {
    console.error(`[ERROR][${module}] ${message}`, error)
  }

  static warn(module, message, data = {}) {
    console.warn(`[WARN][${module}] ${message}`, JSON.stringify(data, null, 2))
  }

  static debug(module, message, data = {}) {
    console.log(`[DEBUG][${module}] ${message}`, JSON.stringify(data, null, 2))
  }
}

module.exports = Logger

